Communication apparatus, control method, and storage medium

ABSTRACT

A communication apparatus is provided that is configured to perform an operation in a first mode in which the communication apparatus operates as a child station, and an operation in a second mode in which the communication apparatus operates as a parent station. The communication apparatus includes a control unit configured to perform control in such a manner that a channel which the communication apparatus uses in the second mode is not used in search while the communication apparatus is operating in the second mode.

BACKGROUND Field

The present disclosure relates to a communication apparatus, a controlmethod, and a storage medium.

Description of the Related Art

Japanese Patent Application Laid-Open No. 2013-157943 discusses atechnique of matching a channel to be used by a wireless communicationapparatus for establishing connection with an access point, and achannel to be used by the wireless communication apparatus forestablishing connection with a mobile terminal via Wi-Fi Direct® (WFD).

On the other hand, as more and more apparatuses each including a mode tooperate as a child station, and a mode to operate as a parent stationare used, improvements in convenience of such an apparatus are demanded.

SUMMARY

According to an aspect of the present disclosure, a communicationapparatus is provided that is configured to perform an operation in afirst mode in which the communication apparatus operates as a childstation in accordance with a predetermined wireless communicationstandard, and an operation in a second mode in which the communicationapparatus operates as a parent station in accordance with thepredetermined wireless communication standard. The communicationapparatus includes a search unit configured to perform search accordingto the predetermined wireless communication standard for one or moreaccess points, an establishment unit configured to establish a wirelessconnection between an access point from the one or more access pointsdiscovered in the search by the search unit and the communicationapparatus operating in the first mode using a channel used to discoverthe access point, and a control unit configured to perform control insuch a manner that a channel which the communication apparatus uses inthe second mode is not used in the search by the search unit while thecommunication apparatus is operating in the second mode.

Further features of the present disclosure will become apparent from thefollowing description of exemplary embodiments with reference to theattached drawings.

BRIEF DESCRIPTION OF THE DRAWINGS

FIG. 1 illustrates a configuration example of a communication system.

FIGS. 2A to 2F each illustrates an example of a screen to be displayedby an operation display unit of a communication apparatus.

FIG. 3 illustrates an example of a wireless connection sequence in asoftware access point (AP) mode.

FIG. 4 illustrates an example of a wireless connection sequence in aWi-Fi Direct® (WFD) mode.

FIG. 5 illustrates an example of a wireless connection sequence in aninfrastructure connection mode.

FIGS. 6A and 6B illustrate an example of channel arrangement in eachfrequency band.

FIG. 7 is a flowchart illustrating processing to be performed by acommunication apparatus.

FIG. 8 is a flowchart illustrating processing to be performed by thecommunication apparatus.

FIG. 9 is a flowchart illustrating processing to be performed by thecommunication apparatus.

FIG. 10 is a flowchart illustrating processing to be performed by thecommunication apparatus.

FIG. 11 is a flowchart illustrating processing to be performed by thecommunication apparatus.

FIG. 12 is a flowchart illustrating processing to be performed by thecommunication apparatus.

FIG. 13 is a flowchart illustrating processing to be performed by thecommunication apparatus.

DESCRIPTION OF THE EMBODIMENTS

Hereinafter, exemplary embodiments of the present disclosure will bedescribed with reference to the drawings. It is to be understood thatthe scope of the present invention also encompasses modifications andimprovements of the exemplary embodiment to be described below that areappropriately made based on the general knowledge of the one skilled inthe art without departing from the gist of the present invention.

A first exemplary embodiment will be described. An informationprocessing apparatus and a communication apparatus included in acommunication system of the present exemplary embodiment will bedescribed. In the present exemplary embodiment, a smartphone isexemplified as the information processing apparatus, but the informationprocessing apparatus is not limited to this. Various types of apparatus,such as a mobile terminal, a laptop personal computer (PC), a tabletterminal, a personal digital assistant (PDA), and a digital camera canbe used as the information processing apparatus. In the presentexemplary embodiment, a printer is exemplified as the communicationapparatus, but the communication apparatus is not limited to this.Various types of apparatus can be used as long as the apparatus canperform wireless communication with the information processingapparatus. For example, when it comes to a printer to be used as thecommunication apparatus, examples of a printer can include an inkjetprinter, a full-color laser beam printer, and a monochrome printer. Inaddition to a printer, examples that can be used also include a copier,a facsimile apparatus, a mobile terminal, a smartphone, a laptop PC, atablet terminal, a PDA, a digital camera, a music play device, atelevision, and a smart speaker. Moreover, a multifunction peripheralincluding a plurality of functions, such as a copy function, a FAXfunction, and a printing function, can also be used.

First of all, a configuration of the information processing apparatusincluded in the communication system of the present exemplaryembodiment, and a configuration of the communication apparatus that cancommunicate with the information processing apparatus will be describedwith reference to a block diagram illustrated in FIG. 1 . In the presentexemplary embodiment, the following configuration example will bedescribed as an example in the present exemplary embodiment, butfunctions are not specifically limited to the functions illustrated inFIG. 1 .

An information processing apparatus 101 includes an input interface 102,a central processing unit (CPU) 103, a read-only memory (ROM) 104, arandom access memory (RAM) 105, an external storage device 106, anoutput interface 107, an operation display unit 108, a communicationunit 109, a short-range communication unit 110, and an imaging apparatus111.

The input interface 102 is an interface for receiving data inputs andoperation instructions from a user, and includes a physical keyboard, abutton, and a touch panel. The output interface 107 to be describedbelow, and the input interface 102 may be configured in an identicalmanner, and an identical configuration may perform screen output andreception of operations from the user.

The CPU 103, a system control unit, generally controls the informationprocessing apparatus 101.

The ROM 104 stores fixed data, such as control programs to be run by theCPU 103, data tables, and an embedded operating system (hereinafter,will be referred to as an OS) program. In the present exemplaryembodiment, each control program stored in the ROM 104 performs softwarerun control, such as scheduling, task switch, or interrupt processing,under the control of the embedded OS stored in the ROM 104.

The RAM 105 includes a static random access memory (SRAM) provided witha backup power source. Because data is held in the RAM 105 with aprimary battery for data backup (not illustrated), the RAM 105 can storeimportant data, such as program control variables, preventing the datafrom being deleted. The RAM 105 is also provided with a memory area forstoring setting information and management data about the informationprocessing apparatus 101. The RAM 105 is also used as a main memory anda work memory for the CPU 103.

The external storage device 106 includes an application that provides aprint execution function (hereinafter, will be referred to as a printingapplication). The external storage device 106 also includes varioustypes of program, such as a print information generation program forgenerating print information interpretable by the communicationapparatus 151, and information transmission/reception control programsto be transmitted to and received from the communication apparatus 151connected via the communication unit 109. The external storage device106 stores various types of information to be used by these programs.The external storage device 106 also stores image data obtained fromanother information processing apparatus or the Internet via thecommunication unit 109.

The output interface 107 is an interface that controls the operationdisplay unit 108 to display data and notify the user of the state of theinformation processing apparatus 101.

The operation display unit 108 includes a light emitting diode (LED) anda liquid crystal display (LCD), and displays data and notifies the userof the state of the information processing apparatus 101. By installinga software keyboard including keys, such as numerical entry keys, a modesetting key, a determination key, a cancel key, and a power key, on theoperation display unit 108, inputs from the user may be received via theoperation display unit 108.

The communication unit 109 is a component for connecting with anapparatus, such as the communication apparatus 151, and performing datacommunication. For example, the communication unit 109 can connect to anaccess point (not illustrated) in the communication apparatus 151. Withthe communication unit 109 and the access point in the communicationapparatus 151 connecting with each other, the information processingapparatus 101 and the communication apparatus 151 is able to communicatewith each other. Hereinafter, an access point may be represented as anAP. The communication unit 109 can directly communicate with thecommunication apparatus 151 via wireless communication, or communicatewith the communication apparatus 151 via an access point 131 outside theinformation processing apparatus 101 and outside the communicationapparatus 151. In the present exemplary embodiment, the Institute ofElectrical and Electronics Engineers (IEEE) 802.11 series communicationstandard is used as a wireless communication method. More specifically,the IEEE 802.11 series communication standard is a standard for WirelessFidelity (Wi-Fi®). Examples of the access point 131 include devices,such as a wireless local area network (LAN) router. In the presentexemplary embodiment, a method by which the information processingapparatus 101 and the communication apparatus 151 directly connect witheach other not via an external access point will be referred to as adirect connection method. A method by which the information processingapparatus 101 and the communication apparatus 151 connect with eachother via the external access point 131 will be referred to as aninfrastructure connection method.

The short-range communication unit 110 is a component for performingshort-range communication with an apparatus, such as the communicationapparatus 151, and performing data communication, and performscommunication using a communication method different from that of thecommunication unit 109. Examples of short-range communication methods tobe used by the short-range communication unit 110 include Bluetooth® andNear Field Communication (NFC). Bluetooth® may be Bluetooth® Classic orBluetooth® Low Energy. The short-range communication unit 110 canconnect with a short-range communication unit 157 in the communicationapparatus 151.

The imaging apparatus 111 is an apparatus that converts an imagecaptured using an image sensor into digital data. The digital data isonce stored into the RAM 105. After that, the digital data is convertedinto a predetermined image format by a program run by the CPU 103, andstored into the external storage device 106 as image data.

A ROM 152 stores fixed data, such as control programs to be run by a CPU154, data tables, and an OS program.

The communication apparatus 151 includes the ROM 152, a RAM 153, the CPU154, a print engine 155, a communication unit 156, the short-rangecommunication unit 157, an input interface 158, an output interface 159,and an operation display unit 160. With a connection mode (communicationmode) set, the communication apparatus 151 can operate in the setconnection mode.

The communication unit 156 is a component for the communicationapparatus 151 connecting with another apparatus. In the presentexemplary embodiment, the communication unit 156 performs communicationin compliance with the IEEE 802.11 series communication standard. Thecommunication unit 156 includes an access point for connecting with anapparatus, such as the information processing apparatus 101, as anaccess point in the communication apparatus 151. The access point canconnect with the communication unit 109 of the information processingapparatus 101. The communication unit 156 can directly communicate withthe information processing apparatus 101 via wireless communication, orcan communicate with the information processing apparatus 101 via theaccess point 131. The communication unit 156 can include hardwarefunctioning as an access point, or can operate as an access point bysoftware for causing the communication unit 156 to function as an accesspoint. In the present exemplary embodiment, the communication unit 156and the short-range communication unit 157 are included in one wirelesschip. More specifically, in the present exemplary embodiment, a combochip supporting both the communication functionality in the IEEE 802.11series communication standard and a communication function carried outin a short-range communication method is used. However, theconfiguration is not limited to this configuration, and thecommunication unit 156 and the short-range communication unit 157 can beincluded in wireless chips different from each other. In the presentexemplary embodiment, a wireless chip supporting the Dynamic rapidchannel switching (DRCS) function is used. The DRCS function is afunction used when communication through infrastructure connection andcommunication through direct connection are performed in a time-divisionmanner during concurrent operation as described below. Specifically, theDRCS function is a function that allows high-speed switching of acommunication channel in use, between a state in which communicationthrough infrastructure connection is being performed, and a state inwhich communication through direct connection is being performed.Hereinafter, a communication channel will be simply referred to as achannel. In the present exemplary embodiment, this function allows achannel used in communication through infrastructure connection and achannel used in communication through direct connection to be differentfrom each other during concurrent operation. The configuration is notlimited to this configuration. For example, the communication unit 156can be included in two or more wireless chips including a wireless chipfor an infrastructure connection mode and a wireless chip for a directconnection mode. With this configuration, a channel used incommunication through infrastructure connection, and a channel used incommunication through direct connection may be made different from eachother during the concurrent operation.

The RAM 153 includes a dynamic RAM (DRAM) provided with a backup powersource. Because data is held in the RAM 153 by power being supplied fromthe power source for data backup (not illustrated), the RAM 153 canstore important data, such as program control variables, preventing thedata from being deleted. The RAM 153 is also used as a main memory and awork memory for the CPU 154, and stores a receive buffer for temporarilystoring print information received from the information processingapparatus 101, and various types of information.

The ROM 152 stores fixed data, such as control programs to be run by theCPU 154, data tables, and an OS program. In the present exemplaryembodiment, each control program stored in the ROM 152 performs softwareexecution control, such as scheduling, task switch, or interruptprocessing, under the control of an embedded OS stored in the ROM 152.The ROM 152 is also provided with a memory area for storing data to beheld also when power is not supplied, such as setting information andmanagement data about the communication apparatus 151.

The CPU 154, a system control unit, generally controls the communicationapparatus 151.

Based on information stored in the RAM 153 or a print job received fromthe information processing apparatus 101, the print engine 155 forms animage onto a recording medium, such as paper, using a recording materialsuch as ink, and outputs a printed result. A print job to be transmittedfrom the information processing apparatus 101 at this time has a largeamount of data to be transmitted in high-speed communication. Thecommunication apparatus 151 therefore receives the print job via thecommunication unit 156 that can perform communication at higher speedthan the short-range communication unit 157.

The short-range communication unit 157 is a component for performingshort-range communication with an apparatus, such as the informationprocessing apparatus 101, and performing data communication, andperforms communication using a communication method different from acommunication method for the communication unit 156. Examples ofshort-range communication methods used by the short-range communicationunit 157 include Bluetooth® and NFC. Bluetooth® may be Bluetooth®Classic or Bluetooth® Low Energy. The short-range communication unit 157can connect with the short-range communication unit 110.

The input interface 158 is an interface for receiving data inputs andoperation instructions from a user, and includes a physical keyboard, abutton, and a touch panel. The output interface 159 as described below,and the input interface 158 may be configured in an identical manner,and an identical configuration may perform screen output and receptionof operations from the user. The output interface 159 is an interfacethat controls the operation display unit 160 to display data and notifythe user of the state of the communication apparatus 151.

The operation display unit 160 includes a display unit, such as an LEDand an LCD, and displays data and notifies the user of the state of thecommunication apparatus 151. By installing a software keyboard includingkeys, such as numerical entry keys, a mode setting key, a determinationkey, a cancel key, and a power key, on the operation display unit 160,inputs from the user may be received via the operation display unit 160.

<Example of Screen to Be Displayed by Operation Display Unit 160>

FIGS. 2A to 2F each schematically illustrate an example of a screen tobe displayed by the operation display unit 160 of the communicationapparatus 151. FIG. 2A illustrates an example of a home screen displayedwhen with the power of the communication apparatus 151 turned on, thecommunication apparatus 151 is in a state (idle state, standby state) ofnot performing an operation, such as printing or scanning. In FIG. 2A, amenu corresponding to the copy function, a menu corresponding to thescanning function, and a menu corresponding to the cloud function aredisplayed. By receiving a key operation or a scroll operation on a touchpanel on the home screen illustrated in FIG. 2A, the communicationapparatus 151 can seamlessly display a screen different from the homescreen illustrated in FIG. 2A. FIG. 2B also illustrates a part of thehome screen, and the display of a menu corresponding to the printfunction (printing function), a menu corresponding to the photofunction, and a menu corresponding to the communication setting changefunction. If a menu is selected by a key operation or a touch paneloperation performed by the user with the home screen illustrated in FIG.2A or 2B displayed, the communication apparatus 151 can start to carryout the function corresponding to the selected menu.

FIG. 2C illustrates an example of a communication selection screendisplayed with the menu corresponding to the communication settingchange function selected on the home screen in FIG. 2B. The screenincludes, for example, a menu for making settings related to wired LAN,a menu for making settings related to wireless LAN, a menu for makingsettings related to wireless direct, and a menu for making settingsrelated to Bluetooth®. With settings made based on a selection of themenu for making settings related to wireless LAN, the communicationapparatus 151 can start an operation in the infrastructure connectionmode as described below. With settings made based on a selection of themenu for making settings related to wireless direct, the communicationapparatus 151 can start an operation in the direct connection mode asdescribed below. Settings made base on a selection of the menu formaking settings related to Bluetooth® can include settings ofenabling/disabling the Bluetooth® function, and settings related topairing of Bluetooth®.

In the present exemplary embodiment, specifically, for example, with themenu for making settings related to wireless direct selected, a screenillustrated in FIG. 2D is displayed. A “change network name (service setidentifier (SSID))” button is a button for the user changing an SSID ofthe communication apparatus 151 operating in the direct connection mode,to a value. A “change password” button is a button for the user changinga password for connecting with the communication apparatus 151 operatingin the direct connection mode, to a value. An “enable/disable directconnection mode” button is a button for activating the direct connectionmode as described below, or stopping the direct connection mode beingactivated. In the present exemplary embodiment, upon a selection of the“enable/disable direct connection mode” button, a Wi-Fi Direct® (WFD)mode as described below is activated, but the configuration is notlimited to this configuration. Either a software AP mode as describedbelow or the WFD mode may be activated, or both modes may be activated.A “set frequency band” button is a button for the user setting afrequency band to be used by the communication apparatus 151 operatingin the direct connection mode to perform communication in the directconnection mode. Upon a selection of the “set frequency band” button, ascreen illustrated in FIG. 2E is displayed. In the present exemplaryembodiment, either 2.4 GHz or 5 GHz is selectable on the screenillustrated in FIG. 2E.

In the present exemplary embodiment, specifically, for example, upon aselection of the menu for making settings related to wireless LAN, ascreen illustrated in FIG. 2F is displayed. A “connect with selectedaccess point” button is a button for establishing the infrastructureconnection as described below, using a first method according to thepresent exemplary embodiment. The first method is a method ofestablishing the infrastructure connection with an access point selectedfrom among a list of access points discovered by search performed by thecommunication apparatus 151, and this method will be described in detailbelow. A “connect using PC/smartphone” button is a button forestablishing the infrastructure connection of the communicationapparatus 151 using a second method according to the present exemplaryembodiment. The second method is a method of transmitting informationfor connecting with an access point, to the communication apparatus 151from an information processing apparatus, such as a PC or a smartphone,and the communication apparatus 151 establishing the infrastructureconnection with the access point using the information. With the“connect using PC/smartphone” button selected, the communicationapparatus 151 operates as a software AP for connecting with a PC or asmartphone. A “connect using Wi-Fi Protected Setup™ (WPS)/AirStationOne-Touch Secure System™ (AOSS)” button is a button for establishing theinfrastructure connection of the communication apparatus 151 using athird method according to the present exemplary embodiment.

The third method is a method of the communication apparatus 151establishing the infrastructure connection with an access point using aknown setting method such as WPS or AOSS.

The methods of the communication apparatus 151 establishing theinfrastructure connection are not limited to the above-describedmethods. In transmitting connection information for connecting with theaccess point 131, to the communication apparatus 151, for example,communication that uses the short-range communication method or a Wi-FiEasy Connect™ function that uses Device Provisioning Protocol (DPP) maybe used. In addition, a button for establishing the infrastructureconnection using such a method may be displayed on the screenillustrated in FIG. 2F.

<Direct Connection Method>

The direct connection refers to a form in which apparatuses wirelesslyconnect with each other directly (i.e., on a peer-to-peer (P2P) basis)not via an external apparatus, such as the access point 131. Thecommunication apparatus 151 can operate in a mode (direct connectionmode) for performing communication through direct connection, as one ofconnection modes. There is a plurality of modes for performingcommunication through direct connection in Wi-Fi® communication, such asthe software AP mode and the WFD mode.

A mode for establishing direct connection via WFD will be referred to asthe WFD mode. WFD is a standard stipulated by Wi-Fi Alliance, and is astandard included in the IEEE 802.11 series communication standard. Inthe WFD mode, after search for a device serving as a communicationpartner is performed using a device search command, roles of a groupowner (GO) in P2P communication and a client in P2P communication aredetermined, and then, the remaining wireless connection processing isperformed. A GO corresponds to a parent station (parent unit) in Wi-Fi®communication, and a client corresponds to a child station (child unit)in Wi-Fi® communication. The role determination corresponds to GONegotiation in P2P communication, for example. In the WFD mode beforerole determination is performed, the communication apparatus 151operates as neither a parent station nor a child station. Specifically,first of all, a device issues a device search command to search foranother device to be connected in the WFD mode among other devices toperform communication with the device. If the other device serving asthe communication partner is discovered, both of the two devices checkinformation regarding services and functions that can be provided by thetwo devices. This device provision information check is optional, andmay not be performed. The device provision information check phasecorresponds to Provision Discovery in P2P communication, for example.Next, by checking the device provision information with each other,which device to operate as the client in P2P communication, and whichdevice to operate as the GO in P2P communication are determined as theirroles. Next, if the client and the GO are determined, both of the twodevices exchange parameters for performing communication via WFD. Basedon the exchanged parameters, the client and the GO in P2P communicationperform the remaining wireless connection processing, and InternetProtocol (IP) connection processing. In the WFD mode, the communicationapparatus 151 may always operate as a GO without performing theabove-described GO Negotiation. In other words, the communicationapparatus 151 may operate in the WFD mode as an Autonomous GO mode. Astate in which the communication apparatus 151 is operating in the WFDmode can be rephrased as a state in which with connection via WFD notestablished, the communication apparatus 151 is operating as a GO, or astate in which with connection via WFD established, the communicationapparatus 151 is operating as a GO, for example.

In the software AP mode, between two devices to perform communicationwith each other (for example, the information processing apparatus 101and the communication apparatus 151), one device (for example, theinformation processing apparatus 101) operates as a client having afunction of issuing requests for various types of service. The otherdevice carries out an access point function in Wi-Fi® communication withsettings of software. A software AP corresponds to a parent station inWi-Fi® communication, and a client corresponds to a child station inWi-Fi® communication. In the software AP mode, the client searches for adevice to operate as a software AP using a device search command. If thesoftware AP is discovered, the client and the software AP perform theremaining wireless connection processing (establishment of wirelessconnection, etc.). After that, the client and the software AP perform IPconnection processing (allocation of IP addresses, etc.). Commands andparameters defined by the Wi-Fi® standard can be used as commands andparameters to be transmitted and received in establishing wirelessconnection between the client and the software AP, and the descriptionthereof will be omitted.

In the present exemplary embodiment, the communication apparatus 151that has established and then maintains direct connection operates as aparent station in a network to which the communication apparatus 151belongs. A parent station refers to an apparatus that establishes awireless network and that provides a child station with parameters to beused in connection to the wireless network. Parameters used inconnection to the wireless network is related to a channel to be used bythe parent station, for example. By receiving parameters, the childstation connects to the wireless network established by the parentstation, using the channel used by the parent station. In the directconnection mode, the communication apparatus 151 operates as a parentstation, so that the communication apparatus 151 can determine afrequency band and a channel to be used for communication in the directconnection mode. In the present exemplary embodiment, the communicationapparatus 151 can use a channel corresponding to the 2.4-GHz frequencyband, and a channel corresponding to the 5-GHz frequency band, forcommunication in the direct connection mode. The user can set afrequency band to be used (i.e., a frequency band of a channel to beused) through a setting made on the screen illustrated in FIG. 2E. Morespecifically, with 2.4 GHz selected on the screen illustrated in FIG.2E, the communication apparatus 151 uses a channel corresponding to the2.4-GHz frequency band, for communication in the direct connection mode.On the other hand, with 5 GHz selected on the screen illustrated in FIG.2E, the communication apparatus 151 uses a channel corresponding to the5-GHz frequency band, for communication in the direct connection mode.In the present exemplary embodiment, even if 5 GHz is selected on thescreen illustrated in FIG. 2E, the communication apparatus 151 does notuse channels corresponding to the Dynamic Frequency Selection (DFS)bands included in the 5-GHz frequency band, for communication in thedirect connection mode. In other words, the communication apparatus 151uses a channel corresponding to a frequency bandwidth other than the DFSbands included in the 5-GHz frequency band, for communication in thedirect connection mode. If radar waves are detected in a channel incurrent use that corresponds to a DFS band, the currently-used channelis changed. Such a frequency band in which a channel change can occurdue to the detection of radar waves refers to a DFS band. For example,when a wireless chip supporting the DFS functionality is used, a channelcorresponding to a DFS band included in the 5-GHz frequency band may beusable for communication in the direct connection mode. A channeldetermined to be a channel to be used in the direct connection mode isused in communication performed via direct connection. Furthermore, thechannel is also used for the transmission of a beacon signal from aparent station, and the transmission of a response to a receivedcommand. In other words, the channel is used for communicationprocessing with direct connection not established, as well as forcommunication processing in the direct connection mode with directconnection established.

The above description has been given of a configuration in which theuser can set a channel to be used in the direct connection mode frombetween a channel corresponding to the 2.4-GHz frequency band and achannel corresponding to the 5-GHz frequency band, but the configurationis not limited to this configuration. A configuration may be used ofallowing the user to set what number channel will be used in the directconnection mode by receiving a designation of the number. A channel tobe used in the direct connection mode may be preset in the communicationapparatus 151 without being set by the user.

The above description has been given of a configuration in which thecommunication apparatus 151 can use the 2.4-GHz frequency band and the5-GHz frequency band, but the configuration is not limited to thisconfiguration. The communication apparatus 151 may be able to use adifferent frequency band. A different frequency band may be used forprocessing for which the 2.4-GHz frequency band or the frequency band isused in the present exemplary embodiment. For example, the frequencyband can be used in the IEEE 802.11ad standard. The 60-GHz frequencyband may therefore be used as the above-described different frequencyband.

Hereinafter, a wireless connection sequence in each mode will bedescribed with reference to FIGS. 3 and 4 .

FIG. 3 illustrates a wireless connection sequence in the software APmode. Processing to be performed by each apparatus in this sequence isperformed by the CPU included in the corresponding apparatus, loadingvarious types of program stored in a memory such as the ROM included inthe corresponding apparatus, onto the RAM, and running the programs.This sequence is started in a state in which the information processingapparatus 101 operates as the client and the communication apparatus 151operates as the software AP, and the communication apparatus 151 istransmitting a beacon signal. When a predetermined operation foroperating as the software AP from the user is received by thecommunication apparatus 151, the communication apparatus 151 starts anoperation as the software AP. The predetermined operation for operatingas the software AP is an operation of selecting the “enable/disabledirect connection mode” button, for example. The operation correspondsto an operation for activating the direct connection mode.

First of all, in step S301, the information processing apparatus 101transmits a device search command using channels usable by theinformation processing apparatus 101 sequentially, and searches for anapparatus to operate as the software AP.

In step S302, if the device search command transmitted from theinformation processing apparatus 101 is received by the communicationapparatus 151, the communication apparatus 151 transmits a device searchresponse as a response to the device search command to the informationprocessing apparatus 101. The communication apparatus 151 does nottransmit a device search response to a device search command transmittedusing a channel other than the channels usable by the communicationapparatus 151. For example, if a channel usable by the communicationapparatus 151 is a fourth channel, the communication apparatus 151 doesnot transmit a device search response to a device search commandtransmitted using a first channel. Thus, if the information processingapparatus 101 has not received a response from the communicationapparatus 151 for a certain period of time or more since transmitting adevice search command using the first channel, the informationprocessing apparatus 101 transmits a device search command using asecond channel. The information processing apparatus 101 repeats theabove-described trial while incrementing the number of a channel to beused. Then, for example, if a device search command transmitted from theinformation processing apparatus 101 using the fourth channel isreceived by the communication apparatus 151, the communication apparatus151 transmits a device search response to the information processingapparatus 101. Consequently, the information processing apparatus 101discovers the communication apparatus 151. The channel used in thetransmission of the device search response is determined to be a channelto be subsequently used in communication between the informationprocessing apparatus 101 and the communication apparatus 151. In otherwords, a channel to be used in communication between the informationprocessing apparatus 101 and the communication apparatus 151 isdetermined by the communication apparatus 151 operating as the softwareAP.

After the information processing apparatus 101 discovers thecommunication apparatus 151, the information processing apparatus 101and the communication apparatus 151 perform known wireless connectionestablishment processing. Specifically, processing, such as thetransmission of a connection request, authentication of the connectionrequest, and allocation of an IP address, is performed. Further,commands and parameters prescribed by the Wi-Fi® standard are used ascommands and parameters to be transmitted and received during theprocessing performed of the wireless connection establishment betweenthe information processing apparatus 101 and the communication apparatus151, and the description thereof will be omitted.

FIG. 4 illustrates a wireless connection sequence in the WFD mode.Processing to be performed by each apparatus in this sequence isperformed by the CPU included in the corresponding apparatus, loadingvarious types of program stored in a memory such as the ROM included inthe corresponding apparatus, onto the RAM, and running the programs. Theprocessing is started when a predetermined operation for establishingconnection via WFD is received from the user with a predeterminedapplication for carrying out a WFD function activated by each apparatus.The predetermined operation for establishing connection via WFD is anoperation of selecting the “enable/disable direct connection mode”button, for example. The operation corresponds to an operation foractivating the direct connection mode.

First of all, in step S401, the information processing apparatus 101transmits a device search command, and searches for an apparatussupporting the WFD function, as the communication partner apparatus.

In step S402, if the received device search command is a commandtransmitted using the same channel as the channel being used in thedirect connection mode, the communication apparatus 151 transmits adevice search response as a response to the device search command to theinformation processing apparatus 101. The information processingapparatus 101 thus discovers the communication apparatus 151 as anapparatus supporting the WFD function. After the information processingapparatus 101 discovers the communication apparatus 151, the informationprocessing apparatus 101 and the communication apparatus 151 may performprocessing of exchanging information regarding services and functionsthat can be provided by the information processing apparatus 101 and thecommunication apparatus 151.

In step S403, the information processing apparatus 101 and thecommunication apparatus 151 perform GO Negotiation. After the client andthe GO are determined, the client and the GO exchange parameters forperforming communication via WFD. Based on the exchanged parameters, theclient and the GO in P2P communication perform the remaining wirelessconnection processing and IP connection processing. As described above,by the communication apparatus 151 operating in the Autonomous GO mode,GO Negotiation may be omitted, and the communication apparatus 151 mayalways operate as a GO. If the communication apparatus 151 operates as aGO, the communication apparatus 151 determines, as a parent station, afrequency band and a channel that are to be used in WFD communication.Thus, the communication apparatus 151 operating as a GO can selecteither a frequency band of 5 GHz or 2.4 GHz as a frequency band to beused, and select a channel to be used, from among channels correspondingto the determined frequency band.

In step S404, based on the exchanged parameters, the informationprocessing apparatus 101 and the communication apparatus 151 performwireless connection establishment processing using the channeldetermined by the GO.

<Infrastructure Connection Method>

The infrastructure connection is a connection mode for connecting withan access point (for example, the access point 131) that controls anetwork of devices that are to perform communication (for example, theinformation processing apparatus 101 and the communication apparatus151), and for the devices communicating with each other via the accesspoint. The communication apparatus 151 can also operate in a mode(infrastructure connection mode) for performing communication viainfrastructure connection, as one of connection modes.

In the infrastructure connection, each device searches for an accesspoint using a device search command. If the access point is discovered,the devices and the access point perform the remaining wirelessconnection processing (wireless connection establishment, etc.). Afterthat, the devices and the access point perform IP connection processing(allocation of IP addresses, etc.). The commands and parametersprescribed by the Wi-Fi® standard are used as commands and parametersthat are to be transmitted and received when wireless connection isestablished between the devices and the access point, and thedescription thereof will be omitted.

When the communication apparatus 151 operates in the infrastructureconnection mode in the present exemplary embodiment, the access point131 operates as the parent station and the communication apparatus 151operates as the child unit. In other words, in the present exemplaryembodiment, the infrastructure connection refers to connection betweenthe communication apparatus 151 operating as a child unit, and anapparatus operating as a parent unit. The communication apparatus 151that has established infrastructure connection and the informationprocessing apparatus 101 that has also established infrastructureconnection with the access point 131 can perform communication via theaccess point 131. A channel to be used in communication viainfrastructure connection is determined by the access point 131, so thatthe communication apparatus 151 performs communication viainfrastructure connection using the channel determined by the accesspoint 131. In the present exemplary embodiment, the communicationapparatus 151 can use a channel in the 2.4-GHz frequency band and achannel in the 5-GHz frequency band in communication via infrastructureconnection. The communication apparatus 151 can also use a channel inthe DFS band included in the 5-GHz frequency band in communication viainfrastructure connection. To communicate with the communicationapparatus 151 via the access point 131, the information processingapparatus 101 will recognize the communication apparatus 151 thatbelongs to a network formed by the access point 131, the network towhich the information processing apparatus 101 belongs.

In the present exemplary embodiment, the communication apparatus 151 canconcurrently establish direct connection and infrastructure connection.In other words, the communication apparatus 151 can concurrentlyestablish Wi-Fi® connection in which the communication apparatus 151operates as a child unit, and Wi-Fi® connection in which thecommunication apparatus 151 operates as a parent unit. Operating withthe above-described two connections concurrently established in thismanner refers to a concurrent operation.

FIG. 5 illustrates a wireless connection sequence in the infrastructureconnection mode. Processing to be performed by each apparatus in thissequence is performed by the CPU included in a corresponding apparatus,loading various types of program stored in a memory such as a ROMincluded in the corresponding apparatus, onto a RAM, and running theprograms. If a predetermined operation for operating in theinfrastructure connection mode from the user is received by thecommunication apparatus 151, the communication apparatus 151 starts anoperation in the infrastructure connection mode. A predeterminedoperation for operating in the infrastructure connection mode is anoperation of selecting the “connect with selected access point” button,for example.

First of all, in step S501, the communication apparatus 151 transmits adevice search command sequentially using channels usable by thecommunication apparatus 151, and searches for an access point existingnear the communication apparatus 151.

In step S502, if the device search command transmitted from thecommunication apparatus 151 is received by the access point 131, theaccess point 131 transmits a device search response as a response to thedevice search command to the communication apparatus 151. The accesspoint 131 transmits the device search response to the device searchcommand alone transmitted using a channel usable by the access point131.

The communication apparatus 151 thus discovers the access point 131. Thechannel used in the transmission of the device search response isdetermined to be a channel to be subsequently used in communicationbetween the communication apparatus 151 and the access point 131. Inother words, a channel to be used for communication in theinfrastructure connection mode is determined by the access point 131.After that, the communication apparatus 151 displays a list ofdiscovered access points, and receives a selection from the user. Inthis example, it is assumed that the access point 131 is selected.

After that, the communication apparatus 151 and the access point 131selected by the user perform known wireless connection establishmentprocessing. Specifically, processing, such as the transmission of aconnection request, authentication of the connection request, andallocation of IP addresses is performed. Similarly to the P2P mode, thecommands and parameters prescribed by the Wi-Fi® standard are used ascommands and parameters that are to be transmitted and received duringthe wireless connection establishment processing performed between theinformation processing apparatus 101 and the communication apparatus151, and the description thereof will be omitted.

In steps S503 and S504, processing similar to the processing in stepsS501 and S502 is performed between the information processing apparatus101 and the access point 131. At this time, the access point 131transmits a device search response command to the information processingapparatus 101 using the channel being used in communication with thecommunication apparatus 151. In other words, the access point 131communicates with the communication apparatus 151 and the informationprocessing apparatus 101 using the same channel.

This described-above configuration allows the communication apparatus151 and the information processing apparatus 101 to connect and thencommunicate with each other via the access point 131.

<Channel Arrangement of Wi-Fi® Communication>

FIG. 6A illustrates channel arrangement in the 2.4-GHz frequency bandand FIG. 6B illustrates channel arrangement in the 5-GHz frequency bandof Wi-Fi® communication. In Wi-Fi® communication, the 2.4-GHz frequencyband, which is divided into channels each having a bandwidth of 22 MHz,is used. Numbers are each allocated to a channel. The channelscorresponding to the 2.4-GHz frequency band are channels 1 to 14. The5-GHz frequency band, which is divided into channels each having abandwidth of 20 MHz, is used, and there are no channels that include thesame frequency. The channels each corresponding to a frequency bandwidthother than the DFS bands in the 5-GHz frequency band is channels calledW52. Specifically, W52 consists of channels 36, 40, 44, and 48. Thechannels in the DFS bands in the 5-GHz frequency band are channelscalled W53 and W56. Specifically, W53 consists of channels 52, 56, 60,and 64, and W56 consists of channels 100, 104, 108, 112, 116, 120, 124,128, 132, 136, and 140.

As described above, in the present exemplary embodiment, thecommunication apparatus 151 can perform the concurrent operation as anoperation of concurrently maintaining the infrastructure connection modeand the direct connection mode. At this time, if a channel to be used inthe infrastructure connection mode and a channel to be used in thedirect connection mode are the same, radio wave interference can occurin communication in both modes. Even in such a case, control can beperformed, for example, using the DRCS function so as not to cause radiowave interference between infrastructure connection and directconnection established by the communication apparatus 151. Nevertheless,also in this form using the DRCS function, interference of communicationbetween an AP infrastructure-connected with the communication apparatus151 and another apparatus can occur on communication of thecommunication apparatus 151 in the direct connection mode.

In the present exemplary embodiment, control for solving theabove-described issue is performed.

<Control to be Performed if Direct Connection Mode is Newly Activated>

Processing to be performed by the communication apparatus 151 in thepresent exemplary embodiment will be described with reference to FIG. 7. The processing to be performed by the communication apparatus 151 inthis flowchart is performed by the CPU 154 loading various types ofprogram stored in a memory such as the ROM 152, onto the RAM 153, andrunning the programs. The processing is started if processing thattriggers the activation of the direct connection mode is performed, forexample, if the above-described operation for activating the directconnection mode from the user is received by the communication apparatus151. The processing that triggers the activation of the directconnection mode includes processing to be performed in the processing tobe described below with reference to FIG. 8, 9 , or 10, for example, inaddition to the reception of the operation for activating the directconnection mode to be performed on the screen illustrated in FIG. 2D.More specifically, for example, the processing is processing of stoppingthe direct connection mode by newly establishing infrastructureconnection during an operation in the direct connection mode. In thepresent exemplary embodiment, the communication apparatus 151 has afunction of restarting an operation in a communication mode at the timeof power-on, the communication mode in which the communication apparatus151 was operating when the power of the communication apparatus 151 wasturned off. The processing that triggers the activation of the directconnection mode is, for example, processing of receiving a power-onoperation after the power is turned off while the communicationapparatus 151 is operating in the direct connection mode. In the presentexemplary embodiment, if the communication apparatus 151 is performingthe concurrent operation when the power of the communication apparatus151 is turned off, upon power-on, the communication apparatus 151initially starts an operation in the infrastructure connection mode toperform processing of reconnecting with an AP. Then, based on the startof reconnection processing, the communication apparatus 151 starts anoperation in the direct connection mode. At this time, the communicationapparatus 151 may start an operation in the direct connection mode basedon the lapse of a predetermined time since the start of the reconnectionprocessing. Alternatively, the communication apparatus 151 may start anoperation in the direct connection mode based on the connectionestablished between an AP and the communication apparatus 151 by thereconnection processing, or based on a time-out caused by a failure inconnection with an AP by reconnection processing.

In step S701, the CPU 154 determines whether 5 GHz is set on the screenillustrated in FIG. 2E, as a frequency band to be used in the directconnection mode. If the CPU 154 determines that 5 GHz is set (YES instep S701), the processing proceeds to step S702. If the CPU 154determines that 2.4 GHz is set (NO in step S701), the processingproceeds to step S705.

In step S702, the CPU 154 determines whether the communication apparatus151 is infrastructure-connected.

If the communication apparatus 151 is infrastructure-connected, the CPU154 then identifies the channel being used in the infrastructureconnection mode, and determines whether the channel being used in theinfrastructure connection mode is the channel 36. In other words, in theprocessing, the CPU 154 determines whether the communication apparatus151 is infrastructure-connected, and the channel being used in theinfrastructure connection mode is the channel 36. Theinfrastructure-connected state means a state in which the communicationapparatus 151 connected with the access point 131 is operating in theinfrastructure connection mode. The channel identified in this stepcorresponds to the channel that is being used in the infrastructureconnection mode when the processing that triggers the activation of thedirect connection mode is performed. If the CPU 154 determines that thecommunication apparatus 151 is infrastructure-connected, and the channelbeing used in the infrastructure connection mode is the channel 36 (YESin step S702), the processing proceeds to step S703. On the other hand,if the CPU 154 determines that the communication apparatus 151 is notconnected with the access point 131, in which the communicationapparatus 151 is not infrastructure-connected, or if the CPU 154determines that the communication apparatus 151 isinfrastructure-connected, but the channel being used in theinfrastructure connection mode is not the channel 36 (NO in step S702),the processing proceeds to step S704. The case where the communicationapparatus 151 is infrastructure-connected means the case where theoperation for activating the direct connection mode is performed on thecommunication apparatus 151 while the communication apparatus 151 isoperating in the infrastructure connection mode(infrastructure-connected).

In step S703, the CPU 154 sets the channel 40 as the channel to be usedin the direct connection mode, and activates the direct connection mode.Specifically, for example, the CPU 154 operates the communicationapparatus 151 in the software AP mode using the channel 40, or in theWFD mode using the channel 40. The communication apparatus 151 therebyoperates concurrently in the infrastructure connection mode using thechannel 36, and in the direct connection mode using the channel 40.After that, the CPU 154 ends the processing. The start of an operationin the direct connection mode brings the communication apparatus 151 tobe able to establish direct connection with another apparatus throughthe processing in the sequence described with reference to FIG. 3 or 4 .

On the other hand, in step S704, the CPU 154 sets the channel 36 as achannel to be used in the direct connection mode, and activates thedirect connection mode. Specifically, for example, the CPU 154 operatesthe communication apparatus 151 in the software AP mode using thechannel 36, or in the WFD mode using the channel 36. The communicationapparatus 151 thereby concurrently operates in the infrastructureconnection mode using a channel other than the channel 36, and in thedirect connection mode using the channel 36, for example. Alternatively,the communication apparatus 151 operates in the direct connection modealone using the channel 36, for example. After that, the CPU 154 endsthe processing.

In step S705, the CPU 154 determines whether the communication apparatus151 is infrastructure-connected. If the communication apparatus 151 isinfrastructure-connected, the CPU 154 then identifies the channel beingused in the infrastructure connection mode, and determines whether thechannel being used in the infrastructure connection mode is the channel3. In other words, in the processing, the CPU 154 determines whether thecommunication apparatus 151 is infrastructure-connected, and the channelbeing used in the infrastructure connection mode is the channel 3. Thechannel identified in this step corresponds to the channel that is beingused in the infrastructure connection mode when the processing thattriggers the activation of the direct connection mode is performed. Ifthe CPU 154 determines that the communication apparatus 151 isinfrastructure-connected, and the channel being used in theinfrastructure connection mode is the channel 3 (YES in step S705), theprocessing proceeds to step S706. On the other hand, if the CPU 154determines that the communication apparatus 151 is not connected withthe access point 131, in which the communication apparatus 151 is notinfrastructure-connected, or if the CPU 154 determines that thecommunication apparatus 151 is infrastructure-connected, but the channelbeing used in the infrastructure connection mode is not the channel 3(NO in step S705), the processing proceeds to step S707.

In step S706, the CPU 154 sets the channel 11 as a channel to be used inthe direct connection mode, and activates the direct connection mode.Specifically, for example, the CPU 154 operates the communicationapparatus 151 in the software AP mode using the channel 11, or in theWFD mode using the channel 11. The communication apparatus 151 therebyoperates concurrently in the infrastructure connection mode using thechannel 3, and in the direct connection mode using the channel 11. Afterthat, the CPU 154 ends the processing.

On the other hand, in step S707, the CPU 154 sets the channel 3 as achannel to be used in the direct connection mode, and activates thedirect connection mode. Specifically, for example, the CPU 154 operatesthe communication apparatus 151 in the software AP mode using thechannel 3, or in the WFD mode using the channel 3. The communicationapparatus 151 thereby concurrently operates in the infrastructureconnection mode using a channel other than the channel 3 and in thedirect connection mode using the channel 3, for example. Alternatively,the communication apparatus 151 operates in the direct connection modealone using the channel 3, for example. After that, the CPU 154 ends theprocessing.

By the above-described processing, if the operation for activating thedirect connection mode is performed on the communication apparatus 151while the communication apparatus 151 is operating in the infrastructureconnection mode, a channel to be used in the infrastructure connectionmode and a channel to be used in the direct connection mode can be madedifferent. Thus, this configuration prevents the occurrence ofinterference in communication in the infrastructure connection mode andcommunication in the direct connection mode.

Channels determined in steps S703, S704, S706, and S707 as channels tobe used are not limited to the above-described channels. As long as thechannels are determined in such a manner that a channel to be used inthe infrastructure connection mode and a channel to be used in thedirect connection mode are made different from each other, channelsdifferent from the above-described channels may be determined to bechannels to be used. Specifically, for example, in step S703, thechannel 44 or 48 may be set as a channel to be used in the directconnection mode. At this time, a channel other than the channelscorresponding to the DFS bands is desirably set.

The above description has been given of a configuration in which thechannel 36 is preferentially used over the channel 40 with 5 GHz set onthe screen illustrated in FIG. 2E as a frequency band to be used in thedirect connection mode. The above description has also been given of aconfiguration in which the channel 3 is preferentially used over thechannel 11 with 2.4 GHz set on the screen illustrated in FIG. 2E as afrequency band to be used in the direct connection mode. The presentexemplary embodiment is not limited to this configuration. A channel tobe preferentially used may be a different channel.

Control may be performed in such a manner that a channel to be used inthe infrastructure connection mode and a channel to be used in thedirect connection mode are made different from each other by processingpartially different from the above-described processing. For example, inplace of the processing in step S702, the CPU 154 may only determinewhether the communication apparatus 151 is infrastructure-connected. Ifthe CPU 154 determines that the communication apparatus 151 isinfrastructure-connected, the CPU 154 may then identify the channelbeing used in the infrastructure connection mode, and then, the CPU 154may specify a channel different from the channel used in theinfrastructure connection mode from among a plurality of channelscorresponding to the 5-GHz frequency band that are usable by thecommunication apparatus 151. After that, the CPU 154 may then set thespecified channel as a channel to be used in the direct connection mode,and activate the direct connection mode. In this case, a channel to bepreferentially specified may be preset. Specifically, for example, thechannel 36 may be preferentially specified as a channel to be used inthe direct connection mode. Similarly, in place of the processing instep S705, for example, the CPU 154 may only determine whether thecommunication apparatus 151 is infrastructure-connected. If the CPU 154determines that the communication apparatus 151 isinfrastructure-connected, the CPU 154 may then identify the channelbeing used in the infrastructure connection mode. After that, the CPU154 may specify a channel different from the channel used in theinfrastructure connection mode from among a plurality of channelscorresponding to the 2.4-GHz frequency band that are usable by thecommunication apparatus 151. After that, the CPU 154 may then set thespecified channel as a channel to be used in the direct connection mode,and activate the direct connection mode. In this case, a channel to bepreferentially specified may be preset. Specifically, for example, thechannel 11 may be preferentially specified as a channel to be used inthe direct connection mode.

The above description has been given of a configuration in which the WFDmode is the Autonomous GO mode, but if the WFD mode is not theAutonomous GO mode but a mode involving the execution of GO Negotiation,the processing may be performed at a timing different from theabove-described timing. In other words, the processing illustrated inFIG. 7 may be started in a case other than the case where the processingthat triggers the activation of the direct connection mode is performed.Specifically, the processing illustrated in FIG. 7 may be started in acase where a device search command of WFD from the informationprocessing apparatus 101 is received the communication apparatus 151, GONegotiation is performed, and it is determined that the communicationapparatus 151 will operate as the GO.

<Control to be Performed if Infrastructure Connection Mode is NewlyActivated>

Processing to be performed by the communication apparatus 151 in thepresent exemplary embodiment will be described with reference to FIG. 8. The processing to be performed by the communication apparatus 151 inthis flowchart is performed by the CPU 154 loading various types ofprogram stored in a memory such as the ROM 152, onto the RAM 153, andrunning the programs. The processing is started if processing thattriggers the activation of the infrastructure connection mode isperformed, and the communication apparatus 151 has tried to establishthe connection with the access point 131 as described with reference toFIG. 5 . The processing that triggers the activation of theinfrastructure connection mode is processing in which the communicationapparatus 151 receives the above-described operation for activating theinfrastructure connection mode from the user, for example. Theprocessing that triggers the activation of the infrastructure connectionmode is processing of receiving a power-on operation after the power isturned off while the communication apparatus 151 is operating in theinfrastructure connection mode, for example.

In step S801, the CPU 154 determines whether the communication apparatus151 has completed the establishment of infrastructure connection (i.e.,connection between the communication apparatus 151 and the access point131). If the CPU 154 determines that the communication apparatus 151 hascompleted the establishment of infrastructure connection (YES in stepS801), the processing proceeds to step S802. If the CPU 154 determinesthat the communication apparatus 151 has not completed the establishmentof infrastructure connection (NO in step S801), the CPU 154 repeats theprocessing in step S801 until the establishment of infrastructureconnection is completed.

In step S802, the CPU 154 stores information indicating the channelbeing used in the infrastructure connection mode into a memory includedin the communication apparatus 151. As a channel to be used in theinfrastructure connection mode is determined by the access point 131 asdescribed above, the channel indicated by the information stored in thisstep is a channel determined by the access point 131.

In step S803, the CPU 154 determines whether the communication apparatus151 is operating in the direct connection mode. A case where the CPU 154determines that the communication apparatus 151 is operating in thedirect connection mode (YES in step S803) means a case where theoperation for activating the infrastructure connection mode has beenperformed on the communication apparatus 151 during the operation of thecommunication apparatus 151 in the direct connection mode. A case wherethe CPU 154 determines that the communication apparatus 151 is notoperating in the direct connection mode (NO in step S803) means a casewhere the operation for activating the infrastructure connection modehas been performed on the communication apparatus 151 with thecommunication apparatus 151 not operating in the direct connection mode.The state in which the communication apparatus 151 is operating in thedirect connection mode includes a state in which the communicationapparatus 151 is operating in the direct connection mode with directconnection not established by the communication apparatus 151. The statein which the communication apparatus 151 is operating in the directconnection mode further includes a state in which the communicationapparatus 151 is operating in the direct connection mode with directconnection established direct connection by the communication apparatus151. The state in which the communication apparatus 151 is operating inthe direct connection mode with direct connection not established by thecommunication apparatus 151 is a state in which the communicationapparatus 151 is operating as a GO or a software AP with directconnection with another apparatus not established. If the CPU 154determines that the communication apparatus 151 is operating in thedirect connection mode (YES in step S803), the processing proceeds tostep S804. If the CPU 154 determines that the communication apparatus151 is not operating in the direct connection mode (NO in step S803),the CPU 154 ends the processing while keeping the communicationapparatus 151 operating in the infrastructure connection mode alone.

In step S804, the CPU 154 determines whether the channel being used inthe infrastructure connection mode and the channel being used in thedirect connection mode are identical to each other. The channel beingused in the infrastructure connection mode is indicated by theinformation stored in step S802. If the CPU 154 determines that thechannel being used in the infrastructure connection mode and the channelbeing used in the direct connection mode are identical to each other(YES in step S804), the processing proceeds to step S805. If the CPU 154determines that the channel being used in the infrastructure connectionmode and the channel being used in the direct connection mode are notidentical to each other (NO in step S804), the CPU 154 ends theprocessing while keeping the communication apparatus 151 concurrentlyoperating in the infrastructure connection mode and the directconnection mode, without disconnecting direct connection nor stoppingthe direct connection mode.

In step S805, the CPU 154 stops the operation in the direct connectionmode being performed by the communication apparatus 151. If thecommunication apparatus 151 has established direct connection, thedirect connection is disconnected.

In step S806, the CPU 154 activates the direct connection mode of thecommunication apparatus 151 again. In other words, the CPU 154 performsthe processing illustrated in the flowchart in FIG. 7 . The directconnection mode is thereby newly activated while the communicationapparatus 151 is operating in the infrastructure connection mode. Insuch a case, as described above with reference to FIG. 7 , control isperformed in such a manner that a channel different from the channelbeing used in the infrastructure connection mode is used in thenewly-activated direct connection mode.

By the above-described processing, if the operation for activating theinfrastructure connection mode is performed on the communicationapparatus 151 while the communication apparatus 151 is operating in thedirect connection mode, the channel to be used in the infrastructureconnection mode and the channel to be used in the direct connection modecan be made different. This prevents the occurrence of interference incommunication in the infrastructure connection mode and communication inthe direct connection mode.

<Control to be Performed if Channel being Used in InfrastructureConnection Mode is Changed During Concurrent Operation>

As described above, a channel to be used in the infrastructureconnection mode is determined by the access point 131. Thus, if achannel being used by the access point 131 is changed by the control forcongestion avoidance, or by setting change of the access point 131 thatis made by the user, the communication apparatus 151 will change achannel being used in the infrastructure connection mode. Control to beperformed when a channel being used in the infrastructure connectionmode is changed during the concurrent operation will now be described.

Processing to be performed by the communication apparatus 151 in thepresent exemplary embodiment will be described with reference to FIG. 9. The processing to be performed by the communication apparatus 151 inthis flowchart is performed by the CPU 154 loading various types ofprogram stored in a memory such as the ROM 152, onto the RAM 153, andrunning the programs. The processing is started while the communicationapparatus 151 is operating in the infrastructure connection mode.

In step S901, the CPU 154 determines whether infrastructure connectionis disconnected. If the CPU 154 determines that infrastructureconnection is disconnected (YES in step S901), the processing proceedsto step S902. If the CPU 154 determines that infrastructure connectionis not disconnected (NO in step S901), the CPU 154 repeats theprocessing in step S901 until infrastructure connection is disconnected.If the channel being used by the access point 131 is changed,infrastructure connection with the access point 131 is disconnected.Thus, the processing corresponds to processing of determining whether achannel being used by the access point 131 is changed. There is anotheraccess point 131 that has a function of notifying the communicationapparatus 151 that the channel being used by the access point 131 willbe changed, before infrastructure connection is disconnected by thechange of a channel being used by the access point 131. Thus, theprocessing may be processing of determining whether the communicationapparatus 151 is notified that a channel being used by the access point131 will be changed.

In step S902, the CPU 154 performs reconnection processing forreconnecting with the access point 131 that was previously connected viathe infrastructure connection that has been disconnected. The CPU 154initially searches for the access point 131 that was previouslyconnected via the infrastructure connection that has been disconnected,as the reconnection processing, sequentially using channels usable bythe communication apparatus 151. The access point 131 that waspreviously connected via the infrastructure connection that has beendisconnected can be identified using a service set identifier (SSID). Ifthe access point 131 is discovered, the CPU 154 establishesinfrastructure connection with the access point 131 using the channelused in the discovery. An operation in the infrastructure connectionmode that uses the channel used in the discovery is thereby started. Asearch method for the access point 131 that was previously connected viathe infrastructure connection that has been disconnected is not limitedto the above-described method. For example, the CPU 154 may initiallysearch for the access point 131 using the channel alone used in theinfrastructure connection that has been disconnected. After that, if theaccess point 131 is not discovered by the search, the CPU 154 may searchfor the access point 131 using another channel.

In step S903, the CPU 154 stores information indicating a changedchannel, into a memory included in the communication apparatus 151.

In step S904, the CPU 154 determines whether the communication apparatus151 is operating in the direct connection mode. A case where the CPU 154determines that the communication apparatus 151 is operating in thedirect connection mode (YES in step S904) means a case where the channelbeing used in the infrastructure connection mode has been changed duringthe concurrent operation performed by the communication apparatus 151. Acase where the CPU 154 determines that the communication apparatus 151is not operating in the direct connection mode (NO in step S904) means acase where the channel being used in the infrastructure connection modehas been changed during the operation by the communication apparatus 151in the infrastructure connection mode alone, without concurrentoperation performed by the communication apparatus 151. If the CPU 154determines that the communication apparatus 151 is operating in thedirect connection mode (YES in step S904), the processing proceeds tostep S905. If the CPU 154 determines that the communication apparatus151 is not operating in the direct connection mode (NO in step S904),the CPU 154 ends the processing while keeping the communicationapparatus 151 operating in the infrastructure connection mode alone.

In step S905, the CPU 154 determines whether the channel being used inthe infrastructure connection mode (i.e., changed channel), and thechannel being used in the direct connection mode are identical to eachother. The channel being used in the infrastructure connection mode isindicated by the information stored in step S903. If the CPU 154determines that the channel being used in the infrastructure connectionmode and the channel being used in the direct connection mode areidentical to each other (YES in step S905), the processing proceeds tostep S906. If the CPU 154 determines that the channel being used in theinfrastructure connection mode and the channel being used in the directconnection mode are not identical to each other (NO in step S905), theCPU 154 ends the processing while keeping the communication apparatus151 concurrently operating in the infrastructure connection mode and thedirect connection mode, without stopping the direct connection mode.

In step S906, the CPU 154 stops the operation in the direct connectionmode that is being performed by the communication apparatus 151. If thecommunication apparatus 151 has established direct connection, thedirect connection is disconnected.

In step S907, the CPU 154 activates the direct connection mode of thecommunication apparatus 151 again. In other words, the CPU 154 performsthe processing illustrated in the flowchart in FIG. 7 . The directconnection mode is thereby newly activated while the communicationapparatus 151 is operating in the infrastructure connection mode. Insuch a case, as described above with reference to FIG. 7 , control isperformed in such a manner that a channel different from the channelbeing used in the infrastructure connection mode is used in thenewly-activated direct connection mode.

In the above description, the communication apparatus 151 stops theoperation in the direct connection mode after the reconnectionprocessing is performed in step S902, but the procedure is not limitedto this. The communication apparatus 151 may stop the operation in thedirect connection mode at a timing that is after the infrastructureconnection is disconnected in step S901 and before reconnectionprocessing is performed in step S902.

A second exemplary embodiment will be described. The above descriptionhas been given of a configuration in which, if the infrastructureconnection mode is newly activated while the communication apparatus 151is operating in the direct connection mode, the channel being used inthe direct connection mode is changed irrespective of whether thecommunication apparatus 151 has established direct connection.

In the present exemplary embodiment, the description will be given of aconfiguration in which, if the infrastructure connection mode is newlyactivated while the communication apparatus 151 is operating in thedirect connection mode but the communication apparatus 151 has notestablished direct connection, the channel being used in the directconnection mode is not changed.

The configuration of a communication system according to the presentexemplary embodiment is similar to the configuration of thecommunication system according to the first exemplary embodiment unlessotherwise stated. Specifically, in the present exemplary embodiment,processing illustrated in a flowchart in FIG. 10 is performed in placeof the processing according to the first exemplary embodiment that isillustrated in the flowchart in FIG. 9 , but the processing in the otherflowcharts are similarly performed.

<Control to be Performed if Infrastructure Connection Mode is NewlyActivated>

Processing to be performed by the communication apparatus 151 in thepresent exemplary embodiment will be described with reference to FIG. 10. The processing to be performed by the communication apparatus 151 inthis flowchart is performed by the CPU 154 loading various types ofprogram stored in a memory such as the ROM 152, onto the RAM 153, andrunning the programs. The processing is started if the communicationapparatus 151 has tried to establish the connection with the accesspoint 131 as described with reference to FIG. 5 in response to thereception of the above-described operation for activating theinfrastructure connection mode from the user by the communicationapparatus 151.

The processing in steps S1001 to S1003 is similar to the processing insteps S801 to S803, and the description will be omitted.

In step S1004, the CPU 154 determines whether the communicationapparatus 151 is directly-connected. A case where the CPU 154 determinesthat the communication apparatus 151 is directly-connected (YES in stepS1004) means a case where the communication apparatus 151 is operatingin the direct connection mode, and the communication apparatus 151 hasestablished direct connection. On the other hand, a case where the CPU154 determines that the communication apparatus 151 is notdirectly-connected (NO in step S1004) means a case where thecommunication apparatus 151 is operating in the direct connection modebut the communication apparatus 151 has not established directconnection. If the CPU 154 determines that the communication apparatus151 is directly-connected (YES in step S1004), the processing proceedsto step S1005. If the CPU 154 determines that the communicationapparatus 151 is not directly-connected (NO in step S1004), theprocessing proceeds to step S1008.

The processing in steps S1005 to S1007 is similar to the processing insteps S804 to S806, and the description will be omitted.

In step S1008, the CPU 154 determines whether the communicationapparatus 151 has completed the establishment of direct connection. Ifthe CPU 154 determines that the communication apparatus 151 hascompleted the establishment of direct connection (YES in step S1008),the processing proceeds to step S1009. If the CPU 154 determines thatthe communication apparatus 151 has not completed the establishment ofdirect connection (NO in step S1008), the CPU 154 repeats the processingin step S1008 until the establishment of direct connection is completed.Further, if the infrastructure connection is disconnected before theestablishment of direct connection is completed, the CPU 154 ends theprocessing.

The processing in steps S1009 to S1011 is similar to the processing insteps S804 to S806, and the description will be omitted.

The control as described in the present exemplary embodiment can alsomake a channel being used in the infrastructure connection mode and achannel being used in the direct connection mode different from eachother. This prevents the occurrence of interference in communication inthe infrastructure connection mode and communication in the directconnection mode.

A third exemplary embodiment will be described. In the above-describedexemplary embodiments, the communication apparatus 151 searches for anaccess point existing near the communication apparatus 151, sequentiallyusing channels usable by the communication apparatus 151, and displays alist of access points discovered by the search, as processing forestablishing infrastructure connection. Then, the communicationapparatus 151 establishes infrastructure connection with an access pointselected from the list.

In the present exemplary embodiment, the description will be given of aconfiguration of making a channel being used in the infrastructureconnection mode and a channel being used in the direct connection modedifferent from each other by searching for an access point existing nearthe communication apparatus 151, using a method different from themethods in the above-described exemplary embodiments.

The configuration of a communication system according to the presentexemplary embodiment is similar to the configurations of thecommunication systems according to the first and second exemplaryembodiments unless otherwise stated.

<Control to be Performed in Search for Access Point Existing NearCommunication Apparatus 151>

Processing to be performed by the communication apparatus 151 in thepresent exemplary embodiment will be described with reference to FIG. 11. The processing to be performed by the communication apparatus 151 inthis flowchart is performed by the CPU 154 loading various types ofprogram stored in a memory such as the ROM 152, onto the RAM 153, andrunning the programs. The processing is started if the above-describedoperation for activating the infrastructure connection mode from theuser is received by the communication apparatus 151.

In step S1101, the CPU 154 determines whether the communicationapparatus 151 is operating in the direct connection mode. If the CPU 154determines that the communication apparatus 151 is operating in thedirect connection mode (YES in step S1101), the processing proceeds tostep S1102. If the CPU 154 determines that the communication apparatus151 is not operating in the direct connection mode (NO in step S1101),the processing proceeds to step S1103.

In step S1102, the CPU 154 identifies the channel being used by thecommunication apparatus 151 in the direct connection mode. Then, the CPU154 searches for an access point existing near the communicationapparatus 151, sequentially using channels excluding the channel beingused by the communication apparatus 151 in the direct connection mode,among all channels usable by the communication apparatus 151. Allchannels usable by the communication apparatus 151 consists of channelsin the 2.4-GHz frequency band, and channels in the 5-GHz frequency bandincluding the DFS bands. The search for an access point existing nearthe communication apparatus 151 will be referred to as AP search. Afterthat, the CPU 154 advances the processing to step S1104.

In step S1103, the CPU 154 searches for an access point existing nearthe communication apparatus 151, sequentially using all channels usableby the communication apparatus 151.

In step S1104, the CPU 154 determines whether one or more access pointsare discovered by the AP search. If the CPU 154 determines that one ormore access points are discovered (YES in step S1104), the processingproceeds to step S1105. If the CPU 154 determines that one or moreaccess points are not discovered (NO in step S1104), the processingreturns to step S1101. If one or more access points are not discoveredby the AP search although the processing are repeated, and a time-outperiod has elapsed, the CPU 154 may end the processing by ending the APsearch, and display a screen indicating that no access point arediscovered.

In step S1105, the CPU 154 displays a list of one or more access pointsdiscovered by the AP search. Then, the CPU 154 receives the selection ofan access point from the list from the user. In the present exemplaryembodiment, as described above, control is performed in such a mannerthat no channel being used by the communication apparatus 151 in thedirect connection mode is used in the AP search. For this reason, thelist does not include the access point using the channel being used bythe communication apparatus 151 in the direct connection mode.

In step S1106, the CPU 154 transmits a connection request to theselected access point, and establishes infrastructure connection withthe selected access point. The channel used in the search and discoveryof the selected access point is used for the transmission of theconnection request and communication via the established infrastructureconnection.

The control according to the present exemplary embodiment in the form ofestablishing infrastructure connection using the first method prevents achannel being used in the direct connection mode and a channel beingused in the infrastructure connection mode from being identical to eachother. This configuration allows a channel to be used in theinfrastructure connection mode and a channel to be used in the directconnection mode to be different from each other, preventing theoccurrence of interference in communication in the infrastructureconnection mode and communication in the direct connection mode.

In the present exemplary embodiment, a form may be applied in which theprocessing in steps S803 to S806 in the processing illustrated in theflowchart in FIG. 8 is not performed. If infrastructure connection isestablished using the second method or the third method, in theprocessing illustrated in the flowchart in FIG. 8 , the processing insteps S803 to S806 may be performed. In other words, it may becontrolled whether to perform the processing in steps S803 to S806 inthe processing illustrated in the flowchart in FIG. 8 based on themethod used for establishing infrastructure connection.

The control according to the present exemplary embodiment may be appliedalso to AP search other than AP search to be started if the operationfor activating the infrastructure connection mode from the user isreceived by the communication apparatus 151. Specifically, for example,the control according to the present exemplary embodiment may be alsoapplied to the reconnection processing in step S902 in the flowchartillustrated in FIG. 9 . More specifically, if the communicationapparatus 151 is operating in the direct connection mode, the CPU 154may search for the access point 131 sequentially using channelsexcluding the channel identified as a channel being used by thecommunication apparatus 151 in the direct connection mode, among allchannels usable by the communication apparatus 151.

A fourth exemplary embodiment will be described. In the presentexemplary embodiment, the description will be given of a configurationof making a channel being used in the infrastructure connection mode anda channel being used in the direct connection mode different from eachother, by searching for an access point existing near the communicationapparatus 151 using a method different from the methods in theabove-described exemplary embodiments.

<Control to be Performed in Search for Access Point Existing NearCommunication Apparatus 151>

Processing to be performed by the communication apparatus 151 in thepresent exemplary embodiment will be described with reference to FIG. 12. The processing to be performed by the communication apparatus 151 inthis flowchart is performed by the CPU 154 loading various types ofprogram stored in a memory such as the ROM 152, onto the RAM 153, andrunning the programs. The processing is started if the above-describedoperation for activating the infrastructure connection mode from theuser is received by the communication apparatus 151.

The configuration of a communication system according to the presentexemplary embodiment is similar to the configurations of thecommunication systems according to the above-described exemplaryembodiments unless otherwise stated. Specifically, in the presentexemplary embodiment, processing illustrated in a flowchart in FIG. 12is performed in place of the processing according to the third exemplaryembodiment that is illustrated in the flowchart in FIG. 11 , but theprocessing in the other flowcharts are similarly performed.

The processing in steps S1201 to S1204 is similar to the processing insteps S1101 to S1104, and the description will be omitted.

In step S1205, the CPU 154 determines whether one or more access pointsare discovered by the AP search in step S1202. If the CPU 154 determinesthat one or more access points are discovered (YES in step S1205), theprocessing proceeds to step S1208. If the CPU 154 determines that one ormore access points are not discovered (NO in step S1205), the processingproceeds to step S1206.

In step S1206, the CPU 154 searches for an access point existing nearthe communication apparatus 151, using the channel being used by thecommunication apparatus 151 in the direct connection mode. In theprocessing, at least the channel being used by the communicationapparatus 151 in the direct connection mode will be used. For thisreason, in the processing, the CPU 154 may search for an access pointexisting near the communication apparatus 151, sequentially using allchannels usable by the communication apparatus 151, for example.

In step S1207, the CPU 154 determines whether one or more access pointsare discovered by the AP search in step S1206. If the CPU 154 determinesthat one or more access points are discovered (YES in step S1207), theprocessing proceeds to step S1208. If the CPU 154 determines that one ormore access points are not discovered (NO in step S1207), the processingreturns to step S1201. If one or more access points are not discoveredby the AP search although the processing is repeated, and a time-outperiod has elapsed, the CPU 154 may end the processing by ending the APsearch, and display a screen indicating that no access point isdiscovered.

The processing in steps S1208 and S1209 is similar to the processing insteps S1105 and S1106, and the description will be omitted.

The control according to the present exemplary embodiment allowsinfrastructure connection that uses a channel being used in the directconnection mode not to be established to the extent possible, preventingthe occurrence of interference in communication in the infrastructureconnection mode and communication in the direct connection mode. If noaccess point is discovered by AP search using a channel being used inthe direct connection mode, AP search using a channel different from thechannel being used in the direct connection mode can increase thepossibility of discovery of an access point.

The control according to the present exemplary embodiment may be appliedalso to AP search other than AP search to be started if the operationfor activating the infrastructure connection mode from the user isreceived by the communication apparatus 151. Specifically, for example,the control according to the present exemplary embodiment may be appliedalso to the reconnection processing in step S902 in the flowchartillustrated in FIG. 9 . More specifically, if the communicationapparatus 151 is operating in the direct connection mode, the CPU 154may search for the access point 131 sequentially using channelsexcluding the channel being used by the communication apparatus 151 inthe direct connection mode, among all channels usable by thecommunication apparatus 151. Then, if the access point 131 is notdiscovered by the AP search, the CPU 154 may search for the access point131 using the channel being used by the communication apparatus 151 inthe direct connection mode.

A fifth exemplary embodiment will be described. The above descriptionhas been given of a configuration in which control is performed in sucha manner that a channel being used in the infrastructure connection modeand a channel being used in the direct connection mode are madedifferent from each other, but in the manner, a frequency band beingused in the infrastructure connection mode and a frequency band beingused in the direct connection mode may be identical to each other.

In the present exemplary embodiment, the description will be given of aconfiguration in which control is performed in such a manner that afrequency band being used in the infrastructure connection mode and afrequency band being used in the direct connection mode are madedifferent from each other, in addition to making a channel being used inthe infrastructure connection mode and a channel being used in thedirect connection mode from each other.

<Control to be Performed if Direct Connection Mode is Newly Activated>

Processing to be performed by the communication apparatus 151 in thepresent exemplary embodiment will be described with reference to FIG. 13. The processing to be performed by the communication apparatus 151 inthis flowchart is performed by the CPU 154 loading various types ofprogram stored in a memory, such as the ROM 152, onto the RAM 153, andrunning the programs. The processing is started if the processing thattriggers the activation of the direct connection mode is performed, forexample, if the above-described operation for activating the directconnection mode from the user is received by the communication apparatus151.

The processing in step S1301 is similar to the processing in step S701,and the description will be omitted.

In step S1302, the CPU 154 determines whether the communicationapparatus 151 is infrastructure-connected state. If the communicationapparatus 151 is infrastructure-connected, the CPU 154 then identifiesthe frequency band being used in the infrastructure connection mode, anddetermines whether the frequency band being used in the infrastructureconnection mode is 5 GHz. In other words, in the processing, the CPU 154determines whether the communication apparatus 151 isinfrastructure-connected, and whether the frequency band being used inthe infrastructure connection mode is 5 GHz. The frequency band beingused in the infrastructure connection mode is identified, for example,based on the identification of the channel being used in theinfrastructure connection mode. The frequency band identified in thisstep is the frequency band used in the infrastructure connection modewhen the processing that triggers the activation of the directconnection mode was performed. The case where the frequency band beingused in the infrastructure connection mode is 5 GHz means the case wherethe channel being used in the infrastructure connection mode is achannel in the 5-GHz frequency band. If the CPU 154 determines that thecommunication apparatus 151 is infrastructure-connected, and thefrequency band being used in the infrastructure connection mode is 5 GHz(YES in step S1302), the processing proceeds to step S1303. If the CPU154 determines that the communication apparatus 151 is not connectedwith the access point 131, in which the communication apparatus 151 isnot infrastructure-connected, or if the CPU 154 determines that thecommunication apparatus 151 is infrastructure-connected, but thefrequency band being used in the infrastructure connection mode is not 5GHz (NO in step S1302), the processing proceeds to step S1304.

In step S1303, the CPU 154 sets a channel of the channels in the 2.4-GHzfrequency band that are usable by the communication apparatus 151, as achannel to be used in the direct connection mode, and activates thedirect connection mode. After that, the CPU 154 ends the processing. Inthis case, a channel to be preferentially used may be preset out of thechannels in the 2.4-GHz frequency band that are usable by thecommunication apparatus 151. Specifically, for example, the channel 11may be preferentially set as a channel to be used in the directconnection mode. In this case, the CPU 154 may automatically change thesetting of a frequency band set on the screen illustrated in FIG. 2E, to2.4 GHz. In this case, the CPU 154 may display a screen for notifyingthe user that the 2.4-GHz frequency band will be used in the directconnection mode.

In step S1304, the CPU 154 sets a channel of the channels in the 5-GHzfrequency band that are usable by the communication apparatus 151, as achannel to be used in the direct connection mode, and activates thedirect connection mode. After that, the CPU 154 ends the processing. Inthis case, a channel to be preferentially used may be preset out of thechannels in the 5-GHz frequency band that are usable by thecommunication apparatus 151. Specifically, for example, the channel 36may be preferentially set as a channel to be used in the directconnection mode.

In step S1305, the CPU 154 determines whether the communicationapparatus 151 is infrastructure-connected. If the communicationapparatus 151 is infrastructure-connected, the CPU 154 then identifiesthe frequency band being used in the infrastructure connection mode, anddetermines whether the frequency band being used in the infrastructureconnection mode is 2.4 GHz. In other words, in the processing, the CPU154 determines whether the communication apparatus 151 isinfrastructure-connected, and the frequency band being used in theinfrastructure connection mode is 2.4 GHz. The frequency band identifiedin this step is the frequency band used in the infrastructure connectionmode when the processing that triggers the activation of the directconnection mode was performed. The frequency band being used in theinfrastructure connection mode is identified, for example, based on theidentification of the channel being used in the infrastructureconnection mode. The case where a frequency band being used in theinfrastructure connection mode is 2.4 GHz means a case where the channelbeing used in the infrastructure connection mode is a channel in the2.4-GHz frequency band. If the CPU 154 determines that the communicationapparatus 151 is infrastructure-connected, and the frequency band beingused in the infrastructure connection mode is 2.4 GHz (YES in stepS1305), the processing proceeds to step S1306. If the CPU 154 determinesthat the communication apparatus 151 is not connected with the accesspoint 131, in which the communication apparatus 151 is notinfrastructure-connected, or if the CPU 154 determines that thecommunication apparatus 151 is infrastructure-connected, but thefrequency band being used in the infrastructure connection mode is not2.4 GHz (NO in step S1305), the processing proceeds to step S1307.

In step S1306, the CPU 154 sets a channel of channels in the 5-GHzfrequency band that are usable by the communication apparatus 151, as achannel to be used in the direct connection mode, and activates thedirect connection mode. After that, the CPU 154 ends the processing. Inthis case, control may be performed in such a manner that a channelother than a channel the DFS bands out of the channels in the 5-GHzfrequency band that are usable by the communication apparatus 151 isset. At this time, a channel to be preferentially used may be determinedout of the channels in the 5-GHz frequency band that are usable by thecommunication apparatus 151. Specifically, for example, the channel 36may be preferentially set as a channel to be used in the directconnection mode. In this case, the CPU 154 may automatically change thesetting of a frequency band set on the screen illustrated in FIG. 2E, to5 GHz. In this case, the CPU 154 may display a screen for notifying theuser that the 5-GHz frequency band will be used in the direct connectionmode.

In step S1307, the CPU 154 sets a channel of channels in the 2.4-GHzfrequency band that are usable by the communication apparatus 151, as achannel to be used in the direct connection mode, and activates thedirect connection mode. After that, the CPU 154 ends the processing. Inthis case, a channel to be preferentially used may be determined out ofthe channels in the 2.4-GHz frequency band that are usable by thecommunication apparatus 151. Specifically, for example, the channel 11may be preferentially set as a channel to be used in the directconnection mode.

The above-described configuration allows control to be performed in sucha manner that a frequency band being used in the infrastructureconnection mode and a frequency band being used in the direct connectionmode are made different from each other, preventing the occurrence ofinterference in communication in the infrastructure connection mode andcommunication in the direct connection mode.

Other Exemplary Embodiments

Needless to say, the object of various embodiments of the presentdisclosure is also achieved by supplying a recording medium on whichprogram codes of software for implementing functions of theabove-described exemplary embodiment are recorded, to a system or anapparatus, and a computer (or a CPU or a micro processing unit (MPU)) ofthe system or the apparatus reading out the program codes stored in therecording medium, and running the program codes. In this case, programcodes read out from a storage medium implements functions of theabove-described exemplary embodiment, and the storage medium storing theprogram codes is included within the scope of the present disclosure.

As a storage medium for supplying program codes, for example, a flexibledisk, a hard disk, an optical disk, a magneto-optical disk, a compactdisk read only memory (CD-ROM), a CD recordable (CD-R), a magnetic tape,a nonvolatile memory card, a ROM, or a digital versatile disk (DVD) canbe used.

Needless to say, a case where an OS operating on the computer performs apart or all of actual processing based on instructions in program codes,and the processing implements functions of the above-described exemplaryembodiment, as well as a case where functions of the above-describedexemplary embodiment are implemented by the computer running read-outprogram codes, is included.

Various embodiment(s) of the present disclosure can also be realized bya computer of a system or apparatus that reads out and executes computerexecutable instructions (e.g., one or more programs) recorded on astorage medium (which may also be referred to more fully as a‘non-transitory computer-readable storage medium’) to perform thefunctions of one or more of the above-described embodiment(s) and/orthat includes one or more circuits (e.g., application specificintegrated circuit (ASIC)) for performing the functions of one or moreof the above-described embodiment(s), and by a method performed by thecomputer of the system or apparatus by, for example, reading out andexecuting the computer executable instructions from the storage mediumto perform the functions of one or more of the above-describedembodiment(s) and/or controlling the one or more circuits to perform thefunctions of one or more of the above-described embodiment(s). Thecomputer may comprise one or more processors (e.g., central processingunit (CPU), micro processing unit (MPU)) and may include a network ofseparate computers or separate processors to read out and execute thecomputer executable instructions. The computer executable instructionsmay be provided to the computer, for example, from a network or thestorage medium. The storage medium may include, for example, one or moreof a hard disk, a random-access memory (RAM), a read only memory (ROM),a storage of distributed computing systems, an optical disk (such as acompact disc (CD), digital versatile disc (DVD), or Blu-ray Disc™ (BD)),a flash memory device, a memory card, and the like.

While exemplary embodiments have been described, it is to be understoodthat the invention is not limited to the disclosed exemplaryembodiments. The scope of the following claims is to be accorded thebroadest interpretation so as to encompass all such modifications andequivalent structures and functions.

This application claims the benefit of Japanese Patent Application No.2022-086418, filed May 26, 2022, which is hereby incorporated byreference herein in its entirety.

What is claimed is:
 1. A communication apparatus configured to performan operation in a first mode in which the communication apparatusoperates as a child station in accordance with a predetermined wirelesscommunication standard, and an operation in a second mode in which thecommunication apparatus operates as a parent station in accordance withthe predetermined wireless communication standard, the communicationapparatus comprising: a search unit configured to perform searchaccording to the predetermined wireless communication standard for oneor more access points; an establishment unit configured to establish awireless connection between an access point from the one or more accesspoints discovered in the search by the search unit and the communicationapparatus operating in the first mode using a channel used to discoverthe access point; and a control unit configured to perform control insuch a manner that a channel which the communication apparatus uses inthe second mode is not used in the search by the search unit while thecommunication apparatus is operating in the second mode.
 2. Thecommunication apparatus according to claim 1, further comprising: adisplay control unit configured to display a list of the one or more ofaccess points discovered in the search; and a reception unit configuredto receive, from a user, selection of an access point from the list ofthe one or more of access points, wherein the establishment unitestablishes a wireless connection between the access point selected bythe user from the list of the one or more access points and thecommunication apparatus operating in the first mode using a channel usedto discover the access point selected by the user.
 3. The communicationapparatus according to claim 2, wherein an access point using thechannel which the communication apparatus uses in the second mode iscontrolled not to be included in the list.
 4. The communicationapparatus according to claim 1, wherein the search is to discover apredetermined access point in accordance with the predetermined wirelesscommunication standard in response to disconnection of connectionbetween the communication apparatus operating in the first mode and thepredetermined access point.
 5. The communication apparatus according toclaim 1, further comprising a second control unit configured to performcontrol in such a manner that a state in which the wireless connectionis maintained after the search is performed while the communicationapparatus is operating in the second mode and a state in which thecommunication apparatus is operating in the second mode are concurrentlymaintained.
 6. The communication apparatus according to claim 1, whereinin a case where no access point is discovered in the search performedwithout using the channel that the communication apparatus uses in thesecond mode, the search unit performs search for the one or more accesspoints using the channel that the communication apparatus uses in thesecond mode.
 7. The communication apparatus according to claim 1,wherein the search is performed using a channel from among a pluralityof channels usable by the communication apparatus other than the channelthat communication apparatus uses in the second mode.
 8. Thecommunication apparatus according to claim 1, further comprising: aspecification unit configured to perform specification of a channeldifferent from the channel that the communication apparatus uses in thesecond mode when specific processing to cause the communicationapparatus to operate in the first mode is performed, as a channel to beused by the communication apparatus in the second mode after thespecific processing is performed, in a case where the specificprocessing is performed while the communication apparatus is operatingin the second mode, the specification being based on a match between thechannel that the communication apparatus uses in the second mode whenthe specific processing is performed and a channel that thecommunication apparatus uses in the first mode which is started by thespecific processing; and a third control unit configured to performcontrol in such a manner that a state in which the communicationapparatus is operating in the first mode and a state in which thecommunication apparatus is operating in the second mode using thechannel specified in the specification are concurrently maintained whilethe specific processing is performed when the communication apparatus isoperating in the second mode.
 9. The communication apparatus accordingto claim 8, the specific processing is at least any of processing toreceive, from a user, selection of an access point from a list of theone or more of access points discovered in search by the communicationapparatus, processing to receive, from a user, an operation forperforming Wi-Fi Protected Setup™ (WPS) or an AirStation One-TouchSecure System™ (AOSS), and processing for reestablishment of connectionin the first mode between the communication apparatus and an accesspoint which follows disconnection of the connection in the first modebetween the communication apparatus and the access point.
 10. Thecommunication apparatus according to claim 1, wherein the second mode isfor the communication apparatus to operate as a software access point.11. The communication apparatus according to claim 1, wherein the secondmode is for the communication apparatus to operate as a group owner in aWi-Fi Direct® standard.
 12. The communication apparatus according toclaim 1, wherein the predetermined wireless communication standard is anInstitute of Electrical and Electronics Engineers (IEEE) 802.11 seriescommunication standard.
 13. The communication apparatus according toclaim 1, wherein communication in the first mode and communication inthe second mode are realized by one wireless chip.
 14. The communicationapparatus according to claim 1, further comprising a printing unitconfigured to perform printing.
 15. The communication apparatusaccording to claim 1, further comprising a scanning unit configured toperform scanning.
 16. The communication apparatus according to claim 1,wherein the first frequency band is 2.4 GHz and the second frequencyband is 5 GHz.
 17. The communication apparatus according to claim 1,wherein a 2.4 GHz frequency band and a 5 GHz frequency band are usablefor communication in the first mode, and wherein a frequency band, whichis either one of a 2.4 GHz frequency band or a 5 GHz frequency band inwhich a channel change based on Dynamic Frequency Selection (DFS) doesnot occur, is usable in the second mode.
 18. The communication apparatusaccording to claim 1, wherein a 2.4 GHz frequency band and a 5 GHzfrequency band are usable for communication in the first mode, andwherein a 2.4 GHz frequency band is usable but a 5 GHz frequency band isnot usable in the second mode.
 19. A control method for a communicationapparatus configured to perform an operation in a first mode in whichthe communication apparatus operates as a child station in apredetermined wireless communication standard, and an operation in asecond mode in which the communication apparatus operates as a parentstation in the predetermined wireless communication standard, thecontrol method comprising: performing search according to thepredetermined wireless communication standard for one or more accesspoints; establishing a wireless connection between an access point fromthe one or more access points discovered in the search and thecommunication apparatus operating in the first mode using a channel usedto discover the access point; and performing control in such a mannerthat a channel which the communication apparatus uses in the second modeis not used in the search while the communication apparatus is operatingin the second mode.
 20. A non-transitory computer-readable storagemedium storing a program for causing a computer to perform a controlmethod for a communication apparatus configured to perform an operationin a first mode in which the communication apparatus operates as a childstation in a predetermined wireless communication standard, and anoperation in a second mode in which the communication apparatus operatesas a parent station in the predetermined wireless communicationstandard, the control method comprising: performing search according tothe predetermined wireless communication standard for one or more accesspoints; establishing a wireless connection between an access point fromthe one or more access points discovered in the search and thecommunication apparatus operating in the first mode using a channel usedto discover the access point; and performing control in such a mannerthat a channel which the communication apparatus uses in the second modeis not used in the search while the communication apparatus is operatingin the second mode.